/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pio.action.preinscrito;

import pio.action.administrador.coordinadores.*;
import DBMS.DataBaseManager;
import clases.Configuracion;
import clases.Coordinador;
import clases.Institucion;
import clases.ReporteCoordinadores;
import clases.ReportePreseleccion;
import clases.TipoReporte;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
import org.apache.struts.actions.DownloadAction.StreamInfo;

/**
 *
 * @author tamerdark
 */
public class DescargablesInscripcion extends DispatchAction {

    public ActionForward page(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        return mapping.findForward("page");
    }


    public ActionForward planillaInscripcion(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
           try
           {            
               
            String path="../webapps/FICHADEINSCRIPCION.pdf";
            //path =request.getContextPath()+"/web/Documentos/INSTRUCCIONESINSCRIPCION.pdf";    
            path =getServlet().getServletConfig().getServletContext()
                    .getRealPath("/")+"FICHADEINSCRIPCION.pdf";
            request.getSession().setAttribute("reporte",path);
            
            return mapping.findForward("success");
        } catch (Exception e) {
            return mapping.findForward("failure");
        }
    }

public ActionForward instruccionesInscripcion(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
           try
           { 
               

            String path="../webapps/INSTRUCCIONESINSCRIPCION.pdf";
            //path =request.getContextPath()+"/INSTRUCCIONESINSCRIPCION.pdf";    
            //path=request.getServletConm   fig().getServletContext().getRealPath ("/")
            //path =getServlet().getServletContext().getRealPath("/");
            path =getServlet().getServletConfig().getServletContext()
                    .getRealPath("/")+"INSTRUCCIONESINSCRIPCION.pdf";
            request.getSession().setAttribute("reporte", path);
            request.setAttribute("reporte", path);
            return mapping.findForward("success");
        } catch (Exception e) {
            return mapping.findForward("failure");
        }
    }
}
